package com.hsck.order.kds.setup.adapter

import androidx.annotation.LayoutRes
import com.hsck.order.kds.R
import com.hsck.order.kds.base.common.BaseAdapter
import com.hsck.order.kds.base.common.BaseViewHolder
import com.hsck.order.kds.base.common.setOnSingleClickListener
import kotlinx.android.synthetic.main.item_sbgl.view.*

/**
 * 设备管理-适配器
 */
class SbglAdapter(@LayoutRes layoutId: Int) : BaseAdapter<String>(layoutId) {

    var onQingKongClick: ((String) -> Unit) = { it -> }
    var onSetZhuKdsClick: ((String) -> Unit) = { it -> }
    var onJieBangClick: ((String) -> Unit) = { it -> }

    override fun onBindViewHolder(holder: BaseViewHolder, data: String) {

        holder.itemView.img_item_sbgl.setImageResource(R.drawable.fj_icon)
        holder.itemView.img_item_sbgl.setImageResource(R.drawable.zj_icon)
        holder.itemView.img_item_sbgl.setImageResource(R.drawable.dyj_icon)
        holder.itemView.btn_item_sbgl_qk.setOnSingleClickListener {
            onQingKongClick.invoke(data)
        }
        holder.itemView.btn_item_sbgl_jiebang.setOnSingleClickListener {
            onJieBangClick.invoke(data)
        }
    }
}